﻿using RabbitMQ.Client;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Topic.Send
{
    class Program
    {
        static void Main(string[] args)
        {
            var factory = new ConnectionFactory() { HostName = "localhost" };
            using (var connection = factory.CreateConnection())
            {
                using (var chanel = connection.CreateModel())
                {
                    chanel.ExchangeDeclare(exchange: "topic_logs", type: "topic");
                    var message = Encoding.UTF8.GetBytes("abcd");
                    chanel.BasicPublish(exchange: "topic_logs", routingKey: "anonymous.info", basicProperties: null, body: message);
                    Console.WriteLine("[x] send {0}", "abcd");
                    Console.ReadKey();
                }
            }
        }
    }
}
